package org.zezs.sync.mongo.config.sync.metadata;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import org.zezs.sync.mongo.dataProess.DefaultJsProesser;
import org.zezs.sync.mongo.dataProess.Proesser;

import java.util.ArrayList;
import java.util.List;

public class Chains {

    @JSONField(serialize = false)
    private SyncEnt ref_syncEnt;
    @JSONField(serialize = false)
    private ProcessInfo processInfo;
    //目的名称，支持es和mongo   也就是系统支持mongo->mongo mongo->es同步
    private String dest;
    //目的类型  mongo es
    private String destType;
    //mongo中databas   es是index
    private String db;
    //mongo中collection es中是type
    private String table;
    //同步规则
    private List<Rules> rules;
    //简单的字段映射，直接从数据源映射到结果中，也可以在处理器脚本中完成所有映射
    private List<Mappings> mappings = new ArrayList<>();
    //为fase时不生效
    private boolean use=true;
    //js脚本，默认处理脚本 效率低下，编写简单
    private String jsscript;
    //java脚本性能高  如果存在jsscript将不生效
    private String javaProesser;
    @JSONField(serialize = false)
    private Proesser proesser=new DefaultJsProesser();

    public void setDest(String dest) {
        this.dest = dest;
    }

    public String getDest() {
        return dest;
    }

    public void setDestType(String destType) {
        this.destType = destType;
    }

    public String getDestType() {
        return destType;
    }

    public void setDb(String db) {
        this.db = db;
    }

    public String getDb() {
        return db;
    }

    public void setTable(String table) {
        this.table = table;
    }

    public String getTable() {
        return table;
    }

    public void setRules(List<Rules> rules) {
        this.rules = rules;
    }

    public List<Rules> getRules() {
        return rules;
    }

    public boolean isUse() {
        return use;
    }

    public void setUse(boolean use) {
        this.use = use;
    }

    public List<Mappings> getMappings() {
        return mappings;
    }

    public void setMappings(List<Mappings> mappings) {
        this.mappings = mappings;
    }

    public SyncEnt getRef_syncEnt() {
        return ref_syncEnt;
    }

    public void setRef_syncEnt(SyncEnt ref_syncEnt) {
        this.ref_syncEnt = ref_syncEnt;
    }

    public String getJsscript() {
        return jsscript;
    }

    public void setJsscript(String jsscript) {
        this.jsscript = jsscript;
    }

    public ProcessInfo getProcessInfo() {
        return processInfo;
    }

    public void setProcessInfo(ProcessInfo processInfo) {
        this.processInfo = processInfo;
    }

    public String getJavaProesser() {
        return javaProesser;
    }

    public void setJavaProesser(String javaProesser) {
        this.javaProesser = javaProesser;
    }

    public Proesser getProesser() {
        return proesser;
    }

    public void setProesser(Proesser proesser) {
        this.proesser = proesser;
    }
}